import Vue from 'vue'
import Router from 'vue-router'
//pages
import Index from './views/index'
import Home from './views/home';
import Layout from './views/layout';
import LayoutTitle from './views/layout-title';
import FormDemo from './views/form-demo';
Vue.use(Router)

const routes = [
    {
        path: '/index',
        component: Index,
        meta: { title: '首页' },
    },
    {
        path: '*',
        redirect: '/index'
    },
    {
        path: '/home',
        name: 'home',
        component: Home,
    },
    {
        path: '/layout',
        name: 'layout',
        component: Layout,
    },
    {
        path: '/layout-title',
        name: 'layoutTitle',
        component: LayoutTitle,
    },
    {
        path: '/form-demo',
        name: 'form-demo',
        component: FormDemo,
    },
]
const router = new Router({
    base: 'test',
    mode: 'history',
    routes: routes
})
export default router